﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace News.CYT369.Com.Models
{
    public class SystemExceptionProcessorAttribute : Microsoft.AspNetCore.Mvc.Filters.ExceptionFilterAttribute
    {
        public override void OnException(Microsoft.AspNetCore.Mvc.Filters.ExceptionContext context)
        {
            var action = context.ActionDescriptor as Microsoft.AspNetCore.Mvc.Controllers.ControllerActionDescriptor;

            //RECP.SaaS.Services.AppService.Instance.SaveAppLog("news.cyt369.com",
            //                                                  (action == null ? string.Empty : string.Format("{0}.{1}", action.ControllerName, action.ActionName)),
            //                                                  context.Exception,
            //                                                  client: context.HttpContext.User.Identity.Name,
            //                                                  remoteIP: context.HttpContext.Connection.RemoteIpAddress.ToString());

            base.OnException(context);
        }

    }
}
